package com.hxexp.weixin.constant;

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 车票状态常量
 * @author li.jiang
 *
 */
public final class TicketState {
    /**
     * 出票失败
     */
    public static final String TICKETED_FAIL = "-1";
    /**
     * 已退票
     */
    public static final String REFUNDED = "0";
    /**
     * 已出票
     */
    public static final String TICKETED_SUCCESS = "1";
    /**
     * 初始状态
     */
    public static final String INITIALIZE = "2";
    /**
     * 已取票
     */
    public static final String COLLECTED_TICKET = "3";
    /**
     * 退票成功，退款失败
     */
    public static final String REFUNDED_REBATE_FAIL = "4";
    /**
     * 退票成功，退款中
     */
    public static final String REFUNDED_REBATING = "5";
    /**
     * 编码和名称的映射
     */
    public static final Map<String, String> CODE_NAME_MAP = Collections.synchronizedMap(new LinkedHashMap<String, String>(7));
    // 映射数据初始化
    static {
        CODE_NAME_MAP.put(TICKETED_FAIL, "失败已退款");
        CODE_NAME_MAP.put(REFUNDED, "已退票");
        CODE_NAME_MAP.put(TICKETED_SUCCESS, "已出票");
        CODE_NAME_MAP.put(INITIALIZE, "初始状态");
        CODE_NAME_MAP.put(COLLECTED_TICKET, "已取票");
        CODE_NAME_MAP.put(REFUNDED_REBATE_FAIL, "退款失败");
        CODE_NAME_MAP.put(REFUNDED_REBATING, "退款中");
    }

    private TicketState() {
    }

}
